package com.zhuss.core.area;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import com.zhuss.bean.bo.core.area.DetailAreaBo;
import com.zhuss.bean.bo.core.area.SearchAreaBo;
import com.zhuss.common.ReadService;
import com.zhuss.core.processor.AreaRead;
import com.zhuss.exception.OceanException;

/**
 * @description: 地域查询Service
 * @author: zhushanshuo
 * @create: Thu Apr 08 20:24:46 CST 2021
 **/
@Component("areaReadService")
public class AreaReadService implements ReadService<Object, Object> {
	
	@Autowired
	@Qualifier("areaRead")
	private AreaRead areaRead;
	
	/**
	 * 详情
	 */
	@Override
	public Object detail(Object param) throws OceanException {
		DetailAreaBo bo = (DetailAreaBo) param;
		Long areaId = bo.getAreaId();
		Object vo = areaRead.detail(areaId);
		return vo;
	}
	
	/**
	 * 列表
	 */
	@Override
	public Object list(Object param) {
		SearchAreaBo bo = (SearchAreaBo) param;
		Object result = areaRead.list(bo);
		return result;
	}
	
}

